/*
 * Copyright (C) 2012 yueyueniao
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hqw.mindanews.fragment;

import com.hqw.mindanews.MainActivity;
import com.hqw.mindanews.R;
import com.hqw.mindanews.utils.PhotoUtil;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

 


public class SettingFragment extends Fragment {
	private TextView mBack;
	private ImageView mHead;
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_settings, null);
		mBack = (TextView) view.findViewById(R.id.back_text);
		mBack.setOnClickListener(new OnClickListener() {
			FragmentTransaction transaction = getFragmentManager().beginTransaction(); 
			@Override
			public void onClick(View v) {
				transaction.remove(SettingFragment.this);
				((MainActivity)getActivity()).showLeft();
				transaction.commit();
			}
		});
//		Resources res=getActivity().getResources();
//		Bitmap bmp=BitmapFactory.decodeResource(res, R.drawable.default_round_head);
//		Bitmap roundBitmap = PhotoUtil.toRoundBitmap(bmp);
		mHead = (ImageView) view.findViewById(R.id.user_icon_image);
		//mHead.setImageBitmap(roundBitmap);
		
		
		return view;
	}

	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
	}

}

